package com.aaa.order.controller.api;

import com.aaa.entity.Order;
import com.aaa.order.service.ALiOrderService;
import com.aaa.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author 崔灿
 * @Date 2023/03/15 16:29
 * @ClassName ALiOrderController
 * @Description
 * @Version 1.0
 */

@RestController
@RequestMapping("/order/ALiOrderPay")
public class ALiOrderController {

    @Autowired
    private ALiOrderService aLiOrderService;
    /**
     * #Description createNative 租车创建订单生成二维码
     * @param order
     * @return 
     * @author 崔灿
     * #Date 
     */
    
    @PostMapping("/createALiNative")
    public Result createNative(@RequestBody Order order){
        return aLiOrderService.createALiNative(order);
    }
/**
 * #Description queryPayStatus1 查询支付的状态
 * @param order
 * @return
 * @author 崔灿
 * #Date
 */
    @PostMapping("/queryPayStatus1")
    public Result queryPayStatus1(@RequestBody Order order){
        return aLiOrderService.queryPayStatus(order.getId());
    }

    /**
     * #Description updateStatus 修改支付后订单状态以及优惠券的库存和车辆库存
     * @param order
     * @return
     * @author 崔灿
     * #Date
     */
    @PostMapping("/updateStatus")
    public Result updateStatus(@RequestBody Order order){
        return aLiOrderService.updateStatus(order);
    }
}
